home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / LISP Related / LISP Goodies / defsys 5.0 / recompile-defsys.l < prev   
Encoding:
Text File  |  1992-09-02  |  2.9 KB  |  78 lines  |  [TEXT/CCL2]

  1. ; -*- mode:     CL -*- ----------------------------------------------------- ;
  2. ; File:         recompile-defsys.l
  3. ; Description:  Recompile DEFSYS if necessary
  4. ; Author:       Joachim H. Laubsch
  5. ; Created:       8-Jul-91
  6. ; Modified:     Tue Aug 11 12:05:59 1992 (Joachim H. Laubsch)
  7. ; Language:     CL
  8. ; Package:      CL-USER
  9. ;;; *************************************************************************
  10. ;;; Copyright (c) 1989, Hewlett-Packard Company
  11. ;;; All rights reserved.
  12. ;;;
  13. ;;; Use and copying of this software and preparation of derivative works
  14. ;;; based upon this software are permitted.  Any distribution of this
  15. ;;; software or derivative works must comply with all applicable United
  16. ;;; States export control laws.
  17. ;;; 
  18. ;;; This software is made available AS IS, and Hewlett-Packard Company
  19. ;;; makes no warranty about the software, its performance or its conformity
  20. ;;; to any specification.
  21. ;;; 
  22. ;;; Suggestions, comments and requests for improvements are welcome
  23. ;;; and should be mailed to laubsch@hplabs.com.
  24. ;;; *************************************************************************
  25.  
  26. (in-package "CL-USER")
  27.  
  28. (proclaim '(optimize (speed 3) (safety 0) (compilation-speed 0)))
  29. ;; This just recompiles defsys when necessary
  30.  
  31. (or (member "expand-file-name" *modules* :test #'string=)
  32.     (let ((*default-pathname-defaults* *DEFSYSTEM-DIRECTORY*))
  33.       (load "expand-file-name.l")))
  34.  
  35. (let* ((*default-pathname-defaults*
  36.     (pathname (expand-file-name *DEFSYSTEM-DIRECTORY*)))
  37.       #-CCL
  38.       (*cl2loadpath*
  39.        (pathname (expand-file-name
  40.           (format nil "~A/" (environment-variable "CL2LOADPATH")))))
  41.       (binary-type  #+LUCID (car *load-binary-pathname-types*)
  42.             #+KCL   "o"
  43.             #+(or MCL ALLEGRO) "fasl"
  44.             #-(or LUCID KCL MCL ALLEGRO) "bin")
  45.       (defsystem-directory-binary
  46.       (make-pathname :directory
  47.              (append
  48.               (pathname-directory *default-pathname-defaults*)
  49.               '("binary"))))
  50.       new)
  51.   #-(or LCL4.0 MCL) (require "defpackage")
  52.   (dolist (f '("expand-file-name" 
  53.            #-(or LCL4.0 MCL) "defpackage"
  54.            "P-defsys"
  55.            "defsys"))
  56.     (let ((source (some #'(lambda (type)
  57.                             (probe-file (format nil "~A.~A" f type)))
  58.                         '("l" "lisp")))
  59.       (binary (merge-pathnames
  60.            (make-pathname :name f :type binary-type)
  61.            defsystem-directory-binary)))
  62.       (when (or new
  63.                 ;; the remaining files depend on this one!
  64.                 (not (probe-file binary))
  65.                 (> (file-write-date source)
  66.                    (file-write-date (probe-file binary))))
  67.         (format t "~%Recompiling ~S to ~S " source binary)
  68.         (setq new t)
  69.         (compile-file source :OUTPUT-FILE binary))
  70.       (require f binary)))
  71.  
  72.   )
  73.  
  74. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  75. ;;                          End of recompile-defsys.l
  76. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  77.  
  78.